#define GDK_WINDOW_IS_MAPPED(window) (((window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
-#define GDK_TYPE_PAINTABLE (_gdk_paintable_get_type ())
-#define GDK_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_PAINTABLE, GdkPaintable))
-#define GDK_IS_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_PAINTABLE))
-#define GDK_PAINTABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GDK_TYPE_PAINTABLE, GdkPaintableIface))
-
-typedef struct _GdkPaintable GdkPaintable;
-typedef struct _GdkPaintableIface GdkPaintableIface;
-
-struct _GdkPaintableIface
-{
- GTypeInterface g_iface;
-
- void (* begin_paint_region) (GdkPaintable *paintable,
- GdkWindow *window,
- const cairo_region_t *region);
- void (* end_paint) (GdkPaintable *paintable);
-};
-
-GType _gdk_paintable_get_type (void) G_GNUC_CONST;
-
void _gdk_window_invalidate_for_expose (GdkWindow *window,
cairo_region_t *region);
}
#endif
-GType
-_gdk_paintable_get_type (void)
-{
- static GType paintable_type = 0;
-
- if (!paintable_type)
- {
- const GTypeInfo paintable_info =
- {
- sizeof (GdkPaintableIface), /* class_size */
- NULL, /* base_init */
- NULL, /* base_finalize */
- };
-
- paintable_type = g_type_register_static (G_TYPE_INTERFACE,
- g_intern_static_string ("GdkPaintable"),
- &paintable_info, 0);
-
- g_type_interface_add_prerequisite (paintable_type, G_TYPE_OBJECT);
- }
-
- return paintable_type;
-}
-
static void
gdk_window_init (GdkWindow *window)
{
const cairo_region_t *region)
{
GdkRectangle clip_box;
+ GdkWindowImplClass *impl_class;
GdkWindowPaint *paint;
GSList *list;
gboolean needs_surface;
!gdk_window_has_impl (window))
return;
- needs_surface = TRUE;
-
- if (GDK_IS_PAINTABLE (window->impl))
- {
- GdkPaintableIface *iface = GDK_PAINTABLE_GET_IFACE (window->impl);
-
- if (iface->begin_paint_region)
- iface->begin_paint_region ((GdkPaintable*)window->impl, window, region);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- needs_surface = FALSE;
- }
+ needs_surface = TRUE;
+ if (impl_class->begin_paint_region)
+ needs_surface = impl_class->begin_paint_region (window, region);
paint = g_new0 (GdkWindowPaint, 1);
paint->region = cairo_region_copy (region);
{
GdkWindow *composited;
GdkWindowPaint *paint;
+ GdkWindowImplClass *impl_class;
GdkRectangle clip_box;
cairo_region_t *full_clip;
cairo_t *cr;
return;
}
- if (GDK_IS_PAINTABLE (window->impl))
- {
- GdkPaintableIface *iface = GDK_PAINTABLE_GET_IFACE (window->impl);
+ impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
- if (iface->end_paint)
- iface->end_paint ((GdkPaintable*)window->impl);
- }
+ if (impl_class->end_paint)
+ impl_class->end_paint (window);
paint = window->paint_stack->data;
gint *x,
gint *y,
GdkModifierType *mask);
+ gboolean (* begin_paint_region) (GdkWindow *window,
+ const cairo_region_t *region);
+ void (* end_paint) (GdkWindow *window);
cairo_region_t * (* get_shape) (GdkWindow *window);
cairo_region_t * (* get_input_shape) (GdkWindow *window);
impl->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
}
-static void
-gdk_window_impl_quartz_begin_paint_region (GdkPaintable *paintable,
- GdkWindow *window,
+static gboolean
+gdk_window_impl_quartz_begin_paint_region (GdkWindow *window,
const cairo_region_t *region)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (paintable);
+ GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->imp);
cairo_region_t *clipped_and_offset_region;
cairo_t *cr;
clipped_and_offset_region = cairo_region_copy (region);
cairo_region_intersect (clipped_and_offset_region,
- window->clip_region_with_children);
+ window->clip_region);
cairo_region_translate (clipped_and_offset_region,
window->abs_x, window->abs_y);
done:
cairo_region_destroy (clipped_and_offset_region);
+
+ return FALSE;
}
static void
-gdk_window_impl_quartz_end_paint (GdkPaintable *paintable)
+gdk_window_impl_quartz_end_paint (GdkWindow *window)
{
- GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (paintable);
+ GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
impl->begin_paint_count--;
NSEnableScreenUpdates ();
}
-static void
-gdk_window_impl_quartz_paintable_init (GdkPaintableIface *iface)
-{
- iface->begin_paint_region = gdk_window_impl_quartz_begin_paint_region;
- iface->end_paint = gdk_window_impl_quartz_end_paint;
-}
-
static const gchar *
get_default_title (void)
{
impl_class->resize_cairo_surface = gdk_window_quartz_resize_cairo_surface;
impl_class->get_shape = gdk_quartz_window_get_shape;
impl_class->get_input_shape = gdk_quartz_window_get_input_shape;
+ impl_class->begin_paint_region = gdk_window_impl_quartz_begin_paint_region;
+ impl_class->end_paint = gdk_window_impl_quartz_end_paint;
impl_class->focus = gdk_quartz_window_focus;
impl_class->set_type_hint = gdk_quartz_window_set_type_hint;
(GInstanceInitFunc) gdk_window_impl_quartz_init,
};
- const GInterfaceInfo paintable_info =
- {
- (GInterfaceInitFunc) gdk_window_impl_quartz_paintable_init,
- NULL,
- NULL
- };
-
object_type = g_type_register_static (GDK_TYPE_WINDOW_IMPL,
"GdkWindowImplQuartz",
&object_info, 0);
- g_type_add_interface_static (object_type,
- GDK_TYPE_PAINTABLE,
- &paintable_info);
}
return object_type;